import request from '@/utils/request'

const api = {
  getBomUrl: '/mes_bom/get_bom',
  getOperForBomUrl: '/mes_bom/get_oper_for_bom',
  addBomUrl: '/mes_bom/add_bom',
  updateUrl: '/mes_bom/update_bom',
}

export async function updateApi(params: Map<string, any>) {
  const res = await request({
    url: api.updateUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function addBomApi(params: Map<string, any>) {
  const res = await request({
    url: api.addBomUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getOperForBomApi(params: Map<string, any>) {
  const res = await request({
    url: api.getOperForBomUrl,
    method: 'get',
    params: params,
  })
  return res
}

export async function getBomApi(params: Map<string, any>) {
  const res = await request({
    url: api.getBomUrl,
    method: 'get',
    params: params,
  })
  return res
}
